Volume Groups
2010/07/25 |
[1] | Create a Volume Group |
root@ubuntu:~# vgcreate VZ /dev/sdb1 # create a Volume group 'VZ' Volume group "VZ" successfully created # insert a space like below if you specify some devices root@ubuntu:~# vgcreate VZ /dev/sdb1 /dev/sdd1 Volume group "VZ" successfully created |
[2] | Display Volume Groups |
root@ubuntu:~# vgdisplay --- Volume group --- VG Name VZ System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 227.89 GB PE Size 4.00 MB Total PE 58339 Alloc PE / Size 0 / 0 Free PE / Size 58339 / 227.89 GB VG UUID AFGDj5-xi8k-e3JO-Sj0j-wVsx-pyA2-3MosMH
|
[3] | Change name of Volume Group |
root@ubuntu:~# vgrename VZ RX-7 # change current name 'VZ' to new name 'RX-7' Volume group "VZ" successfully renamed to "RX-7" root@ubuntu:~# vgdisplay --- Volume group --- VG Name RX-7 # changed System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 227.89 GB PE Size 4.00 MB Total PE 58339 Alloc PE / Size 0 / 0 Free PE / Size 58339 / 227.89 GB VG UUID AFGDj5-xi8k-e3JO-Sj0j-wVsx-pyA2-3MosMH
|
[4] | Output reports of Volume Groups |
root@ubuntu:~# vgs VG #PV #LV #SN Attr VSize VFree VZ 2 0 0 wz--n- 227.89G 227.89G Xen 2 35 0 wz--n- 227.06G 84.06GG |
[5] | Scan Volume Groups |
root@ubuntu:~# vgscan Reading all physical volumes. This may take a while... Found volume group "VZ" using metadata type lvm2 Found volume group "Xen" using metadata type lvm2 |
[6] | Extend a Volume Group |
root@ubuntu:~# vgdisplay --- Volume group --- VG Name VZ System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 153.38 GB PE Size 4.00 MB Total PE 39266 Alloc PE / Size 0 / 0 Free PE / Size 39266 / 153.38 GB VG UUID l4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9 root@ubuntu:~# vgextend VZ /dev/sdd1 # add sdd1 in VZ Volume group "VZ" successfully extended root@ubuntu:~# vgdisplay --- Volume group --- VG Name VZ System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 227.89 GB PE Size 4.00 MB Total PE 58339 Alloc PE / Size 0 / 0 Free PE / Size 58339 / 227.89 GB VG UUID l4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9 |
[7] | Reduce a Volume Group |
root@ubuntu:~# vgreduce VZ /dev/sdd1 # remove sdd1 from VZ Removed "/dev/sdd1" from volume group "VZ" root@ubuntu:~# vgdisplay --- Volume group --- VG Name VZ System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 153.38 GB PE Size 4.00 MB Total PE 39266 Alloc PE / Size 0 / 0 Free PE / Size 39266 / 153.38 GB VG UUID l4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9
|
[8] | Remove a Volume Group |
root@ubuntu:~# vgchange -a n VZ # make VZ non-active first 0 logical volume(s) in volume group "VZ" now active root@ubuntu:~# vgremove VZ # remove VZ Volume group "VZ" successfully removed |